---
id: "variadic-decorator"
keywords: ["variadic", "decorator"]
name: "@variadic"
summary: "This is the `@variadic` decorator."
category: "decorators"
---

The `@variadic` decorator is used to model JavaScript functions that take a variable number of arguments, where all arguments are of the same type.

### Example

<CodeTab labels={["ReScript", "JS Output"]}>

```res
@val @variadic @scope("Math")
external max: array<int> => int = "max"

let result = max([5, -2, 6, 1])
```

```js
var result = Math.max(5, -2, 6, 1);
```

</CodeTab>

### References

- [Variadic Function Arguments](../docs/manual/bind-to-js-function.mdx#variadic-function-arguments)
